home *** CD-ROM | disk | FTP | other *** search
/ A.C.E. 3 / ACE CD 3.iso / files / docs / ppaint6d.lha / PersonalPaint6.4Ch07.doc < prev    next >
Text File  |  1996-03-16  |  25KB  |  567 lines

  1.                 "Personal Paint   -  7. The Color Menu"
  2.  
  3.  7. The Color Menu
  4.   7.1 Palette
  5.        7.1.1 Load Palette
  6.        7.1.2 Save Palette
  7.        7.1.3 Edit Palette
  8.              7.1.3.1 Picking a Color
  9.              7.1.3.2 RGB and HSB Color Models
  10.              7.1.3.3 Copy Color
  11.              7.1.3.4 Swap Colors
  12.              7.1.3.5 Sort Colors
  13.              7.1.3.6 Create Range
  14.              7.1.3.7 Undo
  15.              7.1.3.8 Hide Requester
  16.        7.1.4 Adjust Palette
  17.        7.1.5 Default
  18.        7.1.6 Restore
  19.        7.1.7 Copy Brush Palette
  20.        7.1.8 Copy Font Palette
  21.        7.1.9 Copy Screen Palette
  22.   7.2 Stencil
  23.        7.2.1 Load Stencil
  24.        7.2.2 Save Stencil
  25.        7.2.3 Edit Stencil
  26.        7.2.4 Update Stencil
  27.        7.2.5 Invert Stencil
  28.        7.2.6 Stencil On/Off
  29.        7.2.7 Free Stencil
  30.   7.3 Remap
  31.   7.4 Change Background to Foreground
  32.   7.5 Swap Background and Foreground
  33.   7.6 Merge
  34.   7.7 Less Colors
  35.   7.8 Statistics
  36.  
  37. 7.         The Color Menu
  38.  
  39.    In a paint and image processing program like Personal Paint, color is
  40. everything. Or, at least, nothing could be done without color. An
  41. appropriate choice of colors can make a 64-color image look like a
  42. photograph, give life to a faded picture, or reduce an image's memory
  43. consumption to a fraction of the original, without significant loss of
  44. detail.
  45.  
  46.    The items in the color menu allow the user to access and modify single
  47. colors, as well as apply global color changes. Color palettes can be
  48. loaded, saved and exchanged between objects.
  49.  
  50.  
  51. 7.1        Palette
  52.  
  53.    A palette is the entire set of colors associated to an image. It is
  54. similar to a painter's palette, which contains many different colors that
  55. can be used together. On the Amiga, the more colors are used, the more
  56. resources are needed to process and store an image. Section 1.3.2 explains
  57. the relationship between the image size, number of colors and memory. The
  58. maximum number of colors in a digital palette is always a power of two (2,
  59. 4, 16, 64, 256 etc.)
  60.  
  61.    Different pictures may require special colors, and at the same time may
  62. not use some colors which appear very often in other pictures. Although
  63. palettes having a wide range of different colors (256 colors, for example)
  64. may come very close to fulfilling the needs of most pictures, there may
  65. still be good reasons for using palettes with more limited numbers of
  66. colors.
  67.  
  68.    Using a palette of well selected colors for each picture not only saves
  69. memory and reduces processing time, but also serves the cause of
  70. consistency and style, especially if several pictures must share the same
  71. "atmosphere".
  72.  
  73.  
  74. 7.1.1      Load Palette
  75.  
  76.    Color palette information is stored with all pictures, regardless of
  77. the storage format which is used (except for some two-color formats where
  78. black and white is implied). A color palette can also be saved alone: the
  79. file, instead of containing an image plus a palette, will contain only a
  80. palette.
  81.  
  82.    Load Palette will find and load the color palette from different types
  83. of graphic files (GIF, IFF-ILBM, PCX, etc.), both with or without image.
  84. The new palette will become the palette of the current environment. If the
  85. current screen mode has more colors than the palette which is specified,
  86. then only as many of the first colors as exist in the new palette will be
  87. changed.
  88.  
  89.    As with other functions which modify the palette, the original palette
  90. can be restored invoking Restore Palette (section 7.1.6).
  91.  
  92.  
  93. 7.1.2      Save Palette
  94.  
  95.    This command stores the current color palette into an IFF-ILBM file
  96. (the BMHD, CMAP and CAMG IFF chunks are written). This is a standard and
  97. space efficient way of storing color information, which can be loaded
  98. again with Personal Paint, or by other software.
  99.  
  100.    This command can also be used to overwrite the original "UIColors"
  101. files which define Personal Paint's default menu colors in the
  102. "PPaint_Prefs" disk. This will save about 5 kbytes of disk space (which
  103. may be precious, on floppy disks), since the "UIColors" files are
  104. originally stored as images containing a painted menu and requester to
  105. ease editing. A copy of the original user interface color files should
  106. however also be kept stored for possible future editing requirements.
  107.  
  108.  
  109. 7.1.3      Edit Palette
  110.  
  111.    This requester allows the user to individually set each color in the
  112. palette with the maximum precision allowed by the current screen mode.
  113. There are also functions to copy, swap and sort colors and create new
  114. ranges of colors.
  115.  
  116.    Experimenting with colors, it may sometimes happen that the entire
  117. screen becomes invisible, i.e. all items on the screen have the same
  118. color. The <Help> key can be used to restore the default colors of
  119. Personal Paint for the current screen mode.
  120.  
  121.    Depending on the current color palette, Personal Paint may use
  122. different colors to draw the user interface. The choice for these colors
  123. is determined by legibility, contrast, and "3-D look" parameters. The
  124. colors external to the requester are updated as soon as the mouse pointer
  125. is moved outside the palette requester.
  126.  
  127.  
  128. 7.1.3.1    Picking a Color
  129.  
  130.    The topmost row of colors shows the ordered sequence of palette colors.
  131. An arrow-sign appears over the current color. Upon display of the
  132. requester, this indicates the current foreground color. If the palette has
  133. more colors than can be shown in a line, two scroll-gadgets are displayed
  134. to the right of the color-bar. Clicking on one of these gadgets, or
  135. keeping the gadgets clicked for a longer time, shows more colors in the
  136. selected direction.
  137.  
  138.   In "Extra Half Brite" video modes (64 colors), only the first 32 colors
  139. of the palette can be defined freely. The remaining 32 are automatically
  140. rendered using darker shades of the first 32. The palette requester
  141. therefore only allows the user to edit the first 32 colors.
  142.  
  143.    The current color can be selected by clicking on it with the mouse
  144. (left button). It is also possible to select a color outside the
  145. requester, either in the image or in the main palette. The <Left> and
  146. <Right> cursor keys respectively move the current color to the previous
  147. and next color in the palette.
  148.  
  149.    A small box below the row of palette colors indicates the current color
  150.  both by displaying a rectangle painted with that color, and by showing
  151. the position number of that color within the palette (for example, the
  152. number can range from 0 to 15 in a 16-color map).
  153.  
  154.  
  155. 7.1.3.2    RGB and HSB Color Models
  156.  
  157.    The current color can be modified using the sliders (knobs) which
  158. appear below the row of colors. Two different color models (or coordinate
  159. systems) can be used to specify a color: RGB (Red, Green, Blue) and HSB (
  160. Hue, Saturation, Brightness). The two sets of knobs give a different way
  161. of accessing the same color space. Either one of the two sets of knobs can
  162. be used independently from the other. All possible colors can be obtained
  163. by manipulating only one set of knobs.
  164.  
  165.    In the RGB model, a color is described as a combination of three
  166. primary colors: red, green and blue. The intensity of each color is
  167. specified by a number in the range from 0 to the maximum, which may vary
  168. depending on the screen mode and the version of the Amiga custom chips. In
  169. most modes of Original and Enhanced Amiga sets, red, green and blue can
  170. have 16 different intensities. This means that a color may be picked from
  171. a set of 4096 different colors (16 to the 3rd power). Some ECS video
  172. modes, the A2024 mode and other modes have less (e.g. four) intensity
  173. levels, leading to fewer (e.g. 64) possible colors or gray levels. On
  174. Advanced Graphics Architecture Amiga systems, most video modes can handle
  175. 256 intensity levels for each primary color. 256 to the power of three
  176. gives 16 777 216 possible combinations (so that's where the famous "16
  177. million colors" comes from). Section 1.14 explains how "UIColors" files
  178. with different "granularities" are used for this reason.
  179.  
  180.    Theoretically, if the three primary colors had equal intensity, the
  181. perceived result would be a pure gray ranging from white to black.
  182.  
  183.    In the HSB model (also called HSV, from Hue, Saturation and Value), a
  184. color is described as a position on a color wheel, plus a brightness
  185. value. This abstract color wheel is a sort of a circular rainbow. On the
  186. perimeter of the circle, pure colors (red, green and blue) respectively
  187. appear every 120 degrees (i.e. one third of a circle). The circle begins
  188. and ends with red. Intermediate position values correspond to intermediate
  189. colors. The colors are completely visible around the perimeter of the
  190. circle, and slowly fade out towards the inside of the circle. The center
  191. is completely gray (from white to black, depending on the brightness).
  192.  
  193.    The Hue parameter specifies the angular position of a color on the
  194. wheel: 0 (or 360) = red, 60 = yellow, 120 = green, 180 = cyan, 240 = blue,
  195. 300 = magenta, etc. Saturation indicates the distance of the color from
  196. the center of the circle, in the range from 0 (gray) to 100 (pure color).
  197. Brightness specifies the overall intensity of light (as opposed to the
  198. specific color intensity, which is determined by its saturation). A
  199. brightness of 0 is always black. 100 indicates the maximum possible
  200. brightness for each particular hue/saturation combination.
  201.  
  202.  
  203. 7.1.3.3    Copy Color
  204.  
  205.    To copy a color which already exists in one position in the palette to
  206. another position, it is sufficient to select the first color, click on the
  207. Copy Color gadget, and select the destination position.
  208.  
  209.  
  210. 7.1.3.4    Swap Colors
  211.  
  212.    This is similar to Copy Color, except that the destination color is not
  213. overwritten, but exchanged with the first color.
  214.  
  215.  
  216. 7.1.3.5    Sort Colors
  217.  
  218.    These gadgets sort existing colors in positions from the current color
  219. to the color which is selected after the Sort Colors gadget. Two types of
  220. color sorting exist: from the lightest color in the range to the darkest
  221. one, and from the darkest to the lightest.
  222.  
  223.  
  224. 7.1.3.6    Create Range
  225.  
  226.    These two gadgets create new colors in the position between the current
  227. color and the color which is selected after the gadget. The first (left)
  228. gadget picks colors at intermediate Red, Green and Blue component
  229. positions, while the second calculates the intervals in the Hue,
  230. Saturation and Brightness system.
  231.  
  232.  
  233. 7.1.3.7    Undo
  234.  
  235.    The Undo Last Change gadget undoes the last editing action in the
  236. palette requester, while Restore All restores the initial settings.
  237.  
  238.  
  239. 7.1.3.8    Hide Requester
  240.  
  241.    While this gadget is selected, the requester disappears (only as long
  242. as the left mouse button is held down), making it possible to view those
  243. parts of the image which may normally be hidden. If the right mouse button
  244. is pressed while the left button is held down, the current color "cycles".
  245. Both options are very useful for verifying the possible effects of color
  246. changes without leaving the requester.
  247.  
  248.  
  249. 7.1.4      Adjust Palette
  250.  
  251.    This requester allows the user to apply global color changes to the
  252. current image. This is particular useful when processing for the first
  253. time an image which has been scanned, or before printing an image (colors
  254. generated by scanning and printing devices may differ from the colors
  255. which are displayed, and may therefore require some sort of adjustment).
  256.  
  257.    With the six sliders, it is possible to completely remove, double or
  258. apply intermediate changes to particular color components. All colors in
  259. the palette are affected by the changes. The Edit Palette requester
  260. (section 7.1.3) must be used to individually modify selected colors. In
  261. "Extra Half Brite" video modes (sections 7.1.3.1), the first 32 colors are
  262. changed directly, whereas the second 32 always represent darker variations
  263. of the first 32.
  264.  
  265.    From top to bottom, the sliders respectively affect the color,
  266. brightness, contrast, red, green and blue components. Adjusting the color
  267. is equivalent to modifying the saturation value in the HSB model (section
  268. 7.1.3.2). The contrast knob reduces or increases the distance of the RGB
  269. levels from the median values.
  270.  
  271.    The Keep gadget resets all sliders to the central position after
  272. applying the selected changes. This allows the user to apply changes which
  273. more than double some values, or select a particular order in which to
  274. apply the changes (by default, the adjustments modify all colors in order
  275. indicated by the sliders).
  276.  
  277.    Pressing the <Help> key clears all correction factors, bringing the
  278. sliders back to 0%.
  279.  
  280.  
  281. 7.1.5      Default
  282.  
  283.    This command changes all colors to Personal Paint's default palette.
  284. This palette may either be the program's internal one, or a color palette
  285. file referenced in one of the the "Startup" files (section 8.1.1 and
  286. Appendix C).
  287.  
  288.    By default, the associated shortcut key for this function is <Help>.
  289.  
  290.  
  291. 7.1.6      Restore
  292.  
  293.    This command cancels the last changes made to the color palette,
  294. restoring the colors previously used. It can be invoked twice to restore a
  295. Restore operation.
  296.  
  297.  
  298. 7.1.7      Copy Brush Palette
  299.  
  300.    This function copies the colors of the current custom brush (the one
  301. whose number appears in the tool bar) to the current environment palette.
  302. If the brush has fewer colors than the image, or vice versa, only the
  303. first colors are copied.
  304.  
  305.  
  306. 7.1.8      Copy Font Palette
  307.  
  308.    Color fonts (section 3.1.3.2) are generally created using a specific
  309. color palette which makes them appear best. In these cases, using the font
  310. with a wrong palette would be inappropriate. After loading the desired
  311. font, this command can be used to apply its palette to the current
  312. environments.
  313.  
  314.    If the font's range of colors is too limited for the remaining artwork,
  315. it is sufficient to increase the number of colors (section 4.5.3), leaving
  316. the first colors (i.e. the font's colors) unchanged.
  317.  
  318.  
  319. 7.1.9      Copy Screen Palette
  320.  
  321.    This function copies the colors of the selected screen to the current
  322. environment, without grabbing the screen. The selection of the screen
  323. works as in the Grab Screen function, described in section 4.4.
  324.  
  325.  
  326. 7.2        Stencil
  327.  
  328.    A digital stencil (or color mask) works in a way which is similar to
  329. the sheet of paper or metal with shapes which are cut to define where to
  330. let the ink through. When a stencil is defined or loaded, a new bitmap is
  331. created in addition to the existing image bitplanes. This concept is
  332. somehow similar to the transparency plane, described in section 5.8.5. The
  333. Stencil bitmap contains information about which parts of the image should
  334. be protected from painting operations. Where there are ones, the
  335. underlying image pixels are "protected", where there are zeros all paint
  336. operations will work normally.
  337.  
  338.    A stencil is usually defined in one of two ways: by selectively
  339. protecting all areas having a certain color (color-masking), or by
  340. painting a two-color image, color-masking it and then loading it as a
  341. stencil. Even if the stencil was originally defined by color masking, it
  342. is immediately transformed into a bitmap. This means that Personal Paint
  343. does not protect certain pixels because they appear in a certain color,
  344. but because there is a one in the corresponding stencil plane.
  345.  
  346.    The similarity with the brush transparency plane, which was mentioned
  347. before, may become a confusing equivalence at the file-format level. The
  348. IFF format specifications use the same bitplane to provide both brush
  349. transparency (unless the transparency can be algorithmically defined) and
  350. image stencil information. When a picture with such an additional bitplane
  351. is loaded as a brush, this bitplane would be interpreted as the
  352. transparency plane, while loading the picture as an image would also load
  353. the data as a stencil (and activate that stencil).
  354.  
  355.  
  356. 7.2.1      Load Stencil
  357.  
  358.    This command loads the data stored in a stencil or picture file. In the
  359. IFF-ILBM format, stencil data is always stored with an image if there is
  360. an active stencil when the image is saved.
  361.  
  362.    The size of the stencil should be equal to the image size. If the
  363. stencil is larger, it is cut; if it is smaller, parts of the image (the
  364. lower and right strips missing in the stencil file) will not be
  365. protected.
  366.  
  367.  
  368. 7.2.2      Save Stencil
  369.  
  370.    The stencil plane which was last used in the current environment is
  371. saved in a standard IFF-ILBM stencil file. The IFF chunks which are
  372. written are: BMHD, CAMG and BODY.
  373.  
  374.  
  375. 7.2.3      Edit Stencil
  376.  
  377.    With this requester, it is possible to create a stencil bitmap by
  378. associating the areas to be protected to particular colors. Subsequent
  379. painting operations will not change pixels associated to colors which
  380. appear checkmarked in the requester.
  381.  
  382.    The stencil plane itself is not updated by painting commands, which
  383. may, for example, create new areas in the colors originally protected by
  384. the stencil. The Update Stencil command (section 7.2.4) should be used for
  385. this purpose.
  386.  
  387.    The protection status of a color can be set by clicking on a color box,
  388. or picking a color from the image with the left or right mouse button (to
  389. select or deselect that color). Checkmarks indicate the colors which are
  390. protected.
  391.  
  392.    The Clear gadget removes all checkmarks (such a stencil would be
  393. equivalent to not having a stencil). Invert reverses the on/off status of
  394. the colors. Show removes the requester while the left mouse button is held
  395. down on the gadget, showing masked areas in black and other areas in
  396. white.
  397.  
  398.    When a custom brush is defined (section 3.1.6), only those pixels which
  399. are not masked by the stencil are picked. It is also possible to create a
  400. stencil by drawing it in two colors as an image, and then mask one of the
  401. two colors with this requester.
  402.  
  403.    Section 3.1.4 mentions a case in which a stencil can be used to protect
  404. certain colored areas of the screen from image processing operations.
  405.  
  406.    The two program environments have independent stencil planes.
  407.  
  408.  
  409. 7.2.4      Update Stencil
  410.  
  411.    Normally, a stencil defined as a color mask is defined using the Edit
  412. Stencil requester. Areas which have a particular color may be masked with
  413. that requester, but are not extended when new colors are painted to the
  414. image. This command forces an explicit update of the stencil bitplane
  415. after new colors have been added.
  416.  
  417.  
  418. 7.2.5      Invert Stencil
  419.  
  420.    This function inverts masked stencil areas with unmasked areas. If the
  421. stencil was defined as a color mask, this command has a similar effect as
  422. Invert in the Edit Stencil requester. However, if the stencil was
  423. originally created by drawing it (and is therefore independent from any
  424. particular image colors), only Invert Stencil can be used without
  425. resetting the stencil.
  426.  
  427.  
  428. 7.2.6      Stencil On/Off
  429.  
  430.    This command turns the stencil mask on or off. If the stencil is
  431. switched on for the first time, the Edit Stencil requester appears. Even
  432. if the stencil is switched off, its bitmap is preserved.
  433.  
  434.    A symbol is displayed on the title bar to indicate that the stencil is
  435. active.
  436.  
  437.  
  438. 7.2.7      Free Stencil
  439.  
  440.    This function switches the stencil off and frees the stencil bitplane.
  441. After this command is executed, a stencil must be redefined or loaded to
  442. be used again.
  443.  
  444.  
  445. 7.3        Remap
  446.  
  447.    Sometimes, the colors of an image may be changed even if this is not
  448. desired. This may happen, for example, after applying font or brush colors
  449. to the current image, or after manually changing some colors or simply
  450. replacing the positions of some colors in the palette. After such an
  451. operation, the image which is displayed may have "all colors wrong".
  452.  
  453.    The Remap command uses the current colors to make the image look as
  454. much as possible like it appeared with the previous set of colors (which
  455. may still be used invoking the Restore Palette function). If the same
  456. color exists in both the original and the new palette, Remap simply
  457. updates all references to that color's position in the palette. If some of
  458. the old colors do not exist in the new palette, Personal Paint may either
  459. choose the closest colors, or apply Dithering, Floyd-Steinberg, or other
  460. more sophisticated remapping techniques, as specified in the associated
  461. program options (section 8.7).
  462.  
  463.  
  464. 7.4        Change Background to Foreground
  465.  
  466.    This command applies the foreground color to all background-colored
  467. pixels in the image. It is similar to the same command which can be
  468. applied to brushes (section 5.8.3).
  469.  
  470.  
  471. 7.5        Swap Background and Foreground
  472.  
  473.    Like the previous command, this function exchanges the colors of
  474. background and foreground colored pixels.
  475.  
  476.  
  477. 7.6        Merge
  478.  
  479.    It is often necessary to mix different images, or parts thereof, into a
  480. single picture. For example, this may happen when a scanned photograph is
  481. overlayed over a digital background, when pasting a brush originally
  482. defined in a different environment, or if more than one reduced image is
  483. to be shown on the same page. All these cases may have one common problem:
  484. if the elements which must be joined have different color palettes, the
  485. majority of pixels may appear to have the wrong colors.
  486.  
  487.    With this function, it is possible to selectively merge the color
  488. palettes of all brushes and images currently in use. As a result, one
  489. single palette is created for all the selected items. The final palette
  490. has the same number of colors as that of the current environment. The
  491. colors are carefully chosen, but it may nevertheless happen that there are
  492. not enough colors to correctly represent all individual pixels of all
  493. images and brushes. For this reason, when all items are remapped to the
  494. new palette, dithering, Floyd-Steinberg or other error diffusion
  495. algorithms may be employed, as indicated in the relative program setting
  496. (section 8.7). Section 8.6 describes different methods of color
  497. reduction.
  498.  
  499.    To preserve as many of the original colors as possible, it may be
  500. appropriate to increase the number of colors of the current image (section
  501. 4.5.3). If all the items to be merged had completely different colors, the
  502. resulting map should have as many colors as the sum of the individual
  503. palettes. Fortunately, Personal Paint's color quantization, remapping and
  504. reduction algorithms are so advanced that it is often hard to notice any
  505. difference between the original items and the final image, even if heavy
  506. color reduction has to be applied.
  507.  
  508.    For example, if an image with a 16-color palette, of which only 8 are
  509. used, is merged with an 8-color brush, no colors are lost. Both the image
  510. and the final brush will have a 16-color palette.
  511.  
  512.    After the selected items have been color-merged, they can easily be
  513. pasted as necessary.
  514.  
  515.  
  516. 7.7        Less Colors
  517.  
  518.    This function allows the user to reduce the number of different colors
  519. which are used in the current image. The slider which is displayed in the
  520. requester allows the user to specify the desired number of colors, in the
  521. range from 2 to the amount currently in use. If two or less colors are
  522. used, it would not make sense to further reduce the number of colors.
  523.  
  524.    As the slider is moved, the picture is updated to show the changes,
  525. while the Pixels Lost field informs the user on the relative (percent) and
  526. absolute value of the amount of pixels which had to be "sacrificed". In
  527. qualitative color reduction (section 8.6.1), colors for which there are
  528. similar colors in the palette are eliminated first. If the quantitative
  529. color reduction is selected (section 8.6.2), less used colors are the
  530. first to be suppressed.
  531.  
  532.    If one or more colors appear more than once in the palette, it is
  533. possible to reduce the number of colors used by simple remapping, without
  534. any loss of visual information.
  535.  
  536.    Color reduction is a quite computation-intensive process. The higher
  537. the number of destination colors, the more time it will take to reduce the
  538. image. For example, on Amigas based on the 68000 CPU, it may take some
  539. time every time the slider is moved, if the number of destination colors
  540. is higher than 32.
  541.  
  542.    In "Extra Half Brite" modes (section 7.1.3.1), Personal Paint always
  543. maintains separate blocks of light and dark colors in the palette. A
  544. HBrite palette has always an even number of colors, with the group of
  545. darker colors starting 32 bytes from the beginning.
  546.  
  547.    This command does not explicitly reduce the number of color entries in
  548. the palette; it only reduces the amount of colors used in the image and
  549. groups the colors which are used in the first palette positions. The
  550. desired number of palette colors can be specified in the Screen and Image
  551. Format requester, as explained in section 4.5.2.
  552.  
  553.  
  554. 7.8        Statistics
  555.  
  556.    This requester displays statistics on the colors used in the current
  557. image. For each color in the palette, the program counts how many pixels
  558. exist in the image, and displays the result in the form of a histogram.
  559.  
  560.    If there are more colors than can be represented in the requester, two
  561. scroll arrows are displayed to scroll the histogram in the desired
  562. direction. Additional information (palette color position, amount of
  563. pixels used, surface occupied in percent) on a particular color can be
  564. displayed by clicking on the associated color bar in the histogram. When
  565. the requester is first displayed, this information refers to the current
  566. foreground color.
  567.